home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / objcissu.lha / intermediate-code < prev    next >
Internet Message Format  |  1993-02-27  |  3KB

  1. Date: Tue, 5 Jan 93 16:19:59 -0700
  2. From: Adam Fedor <fedor@focus.colorado.edu>
  3. To: gnu-objc@prep.ai.mit.edu
  4. Subject: questions...
  5.  
  6.  
  7. These are some trivial questions, but I can't seem to get them answered 
  8. anywhere else:
  9.  
  10. 1:  When I compile an Obj-C program using gcc (Version 2.3.2) and -Wall, I
  11.   get the following warning occuring N times, where N is (apparently) the number
  12.   of methods I have in the class:
  13.  
  14.   List.m:299: warning: aggregate has a partly bracketed initializer
  15.  
  16.   Where line 299 is the line AFTER the last line in the file.  What does this 
  17.   error mean?
  18.  
  19. 2: Is there anyway to get gcc to give me the intermediate C code that is
  20.   produced from the Objective-C code that I write?  i.e. I'd like to be able
  21.   to write stuff in Objective-C, but give the programs to people who only have
  22.   a C compiler.
  23.  
  24. 3: Why does gcc not like "#import" statements?  It seems that
  25.   using "#include" with the #ifndef _File_INCLUDE_ statements is kind of a
  26.   ugly way to do this.
  27.  
  28. ---
  29. Adam Fedor. CU, Boulder            | Fudd's Law of Opposition: Push something  
  30. fedor@boulder.colorado.edu (W)      |   hard enough and it will fall over. 
  31. adam@bastille.rmnug.org (H,NeXTMail)|
  32.  
  33. To: Adam Fedor <fedor@focus.colorado.edu>
  34. Cc: gnu-objc@prep.ai.mit.edu
  35. Subject: Re: questions... 
  36. In-Reply-To: (Your message of Tue, 05 Jan 93 16:19:59 MST.)
  37.              <9301052319.AA27146@focus.colorado.edu> 
  38. Date: Tue, 05 Jan 93 18:16:18 -0600
  39. From: Chris Petrilli <petrilli@gnu.ai.mit.edu>
  40.  
  41.  
  42. >>>>> On Tue, 5 Jan 93 16:19:59 -0700, Adam Fedor
  43. >>>>> <fedor@focus.colorado.edu> said:
  44.  
  45.  
  46. Adam> 2: Is there anyway to get gcc to give me the intermediate C code
  47. Adam> that is produced from the Objective-C code that I write?  i.e.
  48. Adam> I'd like to be able to write stuff in Objective-C, but give the
  49. Adam> programs to people who only have a C compiler.
  50.  
  51. Bzzz... thank you for playing :-) GCC doesn't generate anything like C
  52. from Objective-C, but instead generates a "generic" pseudocode (RTL I
  53. believe it's called).  This is portable between GCCs on different
  54. platforms, but not to other compilers.  You could theoretically run
  55. the second pass manually I guess to convert this to object code.  But
  56. Objective-C is not translated a'la C-front code for C++.
  57.  
  58. Chris
  59.  
  60. Date: Wed, 6 Jan 93 21:55:51 -0700
  61. From: jsoft!ggf@uunet.uu.net (Gary Frederick)
  62. To: gnu-objc@prep.ai.mit.edu
  63. Subject: Re: questions... (summary)
  64. Reply-To: ggf@jsoft.com
  65.  
  66. Adam Fedor asked:
  67. > 2: Is there anyway to get gcc to give me the intermediate C code that is
  68. >   produced from the Objective-C code that I write?
  69.  
  70. I was able to get enough info out of the .s file to write C that worked like Objective C.  It helped clarify the documentation on the NeXT Objective C funtions.
  71.  
  72. for example
  73.  
  74.   ...
  75. Integer *myValue = [Integer new: 17];
  76.  
  77. [myValue increment:21];
  78. [myValue print];
  79.  ...
  80.  
  81. can probably be written in C
  82.  
  83.   myValue = msgSend(getClass("Integer"), getUid("init:"), 17);
  84.   msgSend(myValue, getUid("increment:"), 21);
  85.   msgSend(myValue, getUid("print"));
  86.  
  87. NOTE:  I have not tested the C code above.  I did get something like the above to work with Modula-2 calling Objective-C.  C should be easier.
  88.  
  89. Gary
  90. ggf@jsoft.com
  91.  
  92.